<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/13 0013 19:28
 */
require_once "common.php";
if($_POST) {
    $db = SqlDB::init();
	if($db->getExist("select 1 from user where user = ? and pass = ?", $_POST['username'], getPassWord($_POST['username'], $_POST['password']))){

	    header('location:site.php');
	    exit;
	}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>用户登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Boundary Sign in Form template Responsive, Login form web template,Flat Pricing tables,Flat Drop downs  Sign up Web Templates, Flat Web Templates, Login sign up Responsive web template, SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, Sony Ericsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- Custom Theme files -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- //Custom Theme files -->
<!-- web font -->
<link href='//fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css'>
<!-- //web font -->
</head>
<body>
	<h1>登录网站</h1>
<!--form-stars-here-->
		<div class="login-form w3-agile">
			<h2>用户登录</h2>
			<form action="#" method="post">
					<p>用户名</p>
					<input type="text" name="username" placeholder=" " required="" />
					<p>密码</p>
					<input type="password" name="password" placeholder="" required="" />
					<input type="submit" value="登录">
					<a href="register.php">注册</a>
			</form>
		</div>
<!--//form-ends-here-->
<!-- copyright -->
	<div class="copyright w3-agile">
		<p> © 2017 Design Sign in  . All rights reserved | Design by Liu</p>
	</div>
	<!-- //copyright --> 
</body>
</html>